package com.beiding.sqlbuilder.impl;

import com.beiding.sqlbuilder.*;

public class Q {

    private Q() {
    }


    public static QueryBuilder and(OuterQ outerQ) {
        SimpleQueryBuilder q = new SimpleQueryBuilder();
        SimpleConnectorConditionUnitContainer container = new SimpleConnectorConditionUnitContainer(LogicType.And);
        container.setInner(false);
        q.setConditionUnitContainer(container);
        outerQ.outer(q);
        return q;
    }

    public static QueryBuilder or(OuterQ outerQ) {
        SimpleQueryBuilder q = new SimpleQueryBuilder();
        SimpleConnectorConditionUnitContainer container = new SimpleConnectorConditionUnitContainer(LogicType.Or);
        container.setInner(false);
        q.setConditionUnitContainer(container);
        outerQ.outer(q);
        return q;
    }


    public interface OuterQ {
        void outer(SimpleQueryBuilder q);
    }

}
